package com.dx.spring0_5.otherBean;

import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

public class Main {

	public static void main(String[] args) {
		
		ApplicationContext ctx = new ClassPathXmlApplicationContext("com/dx/spring0_5/otherBean/otherBeanApplicationContext.xml");
		
//		Person person = ctx.getBean(Person.class); // 有缺点，多个Bean有相同的HelloWorld
//		System.out.println(person);
		
		Person person1 = (Person)ctx.getBean("person");
		System.out.println(person1);
		
		Person person2 = (Person)ctx.getBean("person2");
		System.out.println(person2);
	}
}
